using System;
using System.Collections;
using System.Collections.Generic;
using UMC.Web;
using UMC.WorkFlow.Entities;

namespace UMC.WorkFlow.Subassembly
{


    [Apiumc("WorkFlow", "Select", Auth = WebAuthType.Admin, Desc = "选择流程表单", Category = 1)]
    public class WorkFlowSelectActivity : WebActivity
    {
        public override void ProcessActivity(WebRequest request, WebResponse response)
        {
            var key = this.AsyncDialog("Key", g => this.DialogValue("Promotion"));

            var SId = UMC.Data.Utility.UInt64Parse(this.AsyncDialog("Id", g =>
            {
                var grid = new TaskFormGridDialog
                {
                    Title = "流程表单",
                    CloseEvent = "UI.Event"
                };
                return grid;
            })).Value;

            var form = DataFactory.Instance().TaskForm(SId);

            this.Context.UIEvent(key, new ListItem()
            {
                Value = form.TaskId.ToString(),
                Text = form.Caption
            }), true);


        }

    }

}